import styles from './cmsList.less';
import { Flex } from 'antd-mobile';
export default function(props) {
  return (
    <Flex direction="column">
      {props.cmsList.map((cms, index) => (
        <Flex.Item
          className={styles.cmsListItem}
          key={index}
          onClick={() => {
            props.onClick(index);
          }}
        >
          <img src={cms.thumb} className={styles.thumb} />
          <Flex.Item className={styles.post}>
            <span className={styles.title}>{cms.title}</span>
            <div className={styles.content} dangerouslySetInnerHTML={{ __html: cms.content }} />
          </Flex.Item>
        </Flex.Item>
      ))}
    </Flex>
  );
}
